package com.tony;

public class UserService {

    private MailService mailService;

    public void setMailService(MailService mailService) {
        this.mailService = mailService;
    }


    public void login(String userName, String passWord) {
        if (userName.equals("admin") && passWord.equals("123456")) {
            System.out.println("登录成功：" + userName);
            mailService.send(userName);
        } else {
            System.out.println("用户或密码错误");
        }
    }

}
